package io.renren.sf.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.sf.dao.HzCopybookCharacterDao;
import io.renren.sf.entity.HzCopybookCharacterEntity;
import io.renren.sf.service.HzCopybookCharacterService;


@Service("hzCopybookCharacterService")
public class HzCopybookCharacterServiceImpl extends ServiceImpl<HzCopybookCharacterDao, HzCopybookCharacterEntity> implements HzCopybookCharacterService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<HzCopybookCharacterEntity> page = this.page(
                new Query<HzCopybookCharacterEntity>().getPage(params),
                new QueryWrapper<HzCopybookCharacterEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<HzCopybookCharacterEntity> queryCopybookCharacter(Integer curPage, Integer pageSize, String coChrName) {
        curPage = (curPage-1) * pageSize;
        return this.baseMapper.queryCopybookCharacter(curPage, pageSize, coChrName);
    }

    @Override
    public Integer queryCopybookCharacterNum(String coChrName) {
        return this.baseMapper.queryCopybookCharacterNum(coChrName);
    }

}